//
//  ViewHelp.swift
//  foreign_swift
//
//  Created by hdr on 15-4-10.
//  Copyright (c) 2015年 hdr. All rights reserved.
//

import UIKit

struct ViewHelper {
    //根据图片的文件名初始化一个ImageView，大小为指定图片的大小
    static func initImageViewWithImageName(name:String)->UIImageView{
        var image = UIImage(named: name)
        var iv = UIImageView();
        iv.image = image
        iv.bounds = CGRect(origin: CGPointZero, size: image!.size)
        return iv;
        
    }
    
    static func changeToRedButton(button:UIButton){
        button.layer.cornerRadius = 5
        button.backgroundColor = UIColor.makeWithIntRGB(255, 41, 46)
        
        button.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal)
    }
}
